<template>
     <div class="useract hotword" id="partake"></div>
</template>
<script>
 import echarts from 'echarts'
export default {
  data(){
    return{
       chart: null,
    }
  },
  created:function(){
    this.$nextTick(() => {
      this.drawPar('partake')
    })
  },
  methods:{
    drawPar(id){
      this.chart = echarts.init(document.getElementById(id))
      this.chart.setOption({
            tooltip: {
                    show: true
              },
             legend: {
                 data: ['总件数', '总净重', '总毛重']
             },
             xAxis: [
                {
                     type: 'category',
                     data: ["2018-3-1","2018-3-2","2018-3-3","2018-3-4","2018-3-5"]
                 }
             ],
             yAxis: [
                 {
                     type: 'value'
                 }
             ],
             series: [
                 {
                     "name": "总件数",
                     "type": "bar",
                     "data": [
                        {name:"hfi",value:"78"},
                        {name:"hfi",value:"128"},
                        {name:"hfi",value:"28"},
                        {name:"hfi",value:"58"},
                        {name:"hfi",value:"68"}
                     ]
                 }, {
                     "name": "总净重",
                     "type": "bar",
                     "data":[
                        {name:"hfi",value:"78"},
                        {name:"hfi",value:"128"},
                        {name:"hfi",value:"28"},
                        {name:"hfi",value:"58"},
                        {name:"hfi",value:"68"}
                     ]
                 }, {
                     "name": "总毛重",
                     "type": "bar",
                     "data":[
                        {name:"hfi",value:"78"},
                        {name:"hfi",value:"128"},
                        {name:"hfi",value:"28"},
                        {name:"hfi",value:"58"},
                        {name:"hfi",value:"68"}
                     ]
                 }
             ]


      })
    }
  }
}
</script>
<style>
.hotword{width:100%;height:500px;}
</style>